Retrieve the setting for a particular option in named query options.
Request Headers | |
---|---|
Accept* |
The expected MIME type of the information in the response.
Accepted types: application/json or
application/xml . Ignored if the request includes a
format parameter value.
|
Upon success, MarkLogic Server responds with a 200 staus and returns the requested information in the response body, in the format requested.
rest-reader
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/rest-reader
The {element-name}
component of the request URI must be
the localname of a child element of search:options
. For
information on query options, see
PUT /v1/config/query/(default|{name})
.
The response body contains a search:options
node, expressed
as either XML or JSON, depending on the setting of the format
parameter or Accept header. The returned options node contains only
the request child element(s). For information about the structure and
contents of query options, see
PUT /v1/config/query/(default|{name})
.
For more details, see Configuring Query Options in the REST Application Developer's Guide.
Assume the following options are installed under the name "my-options": <options xmlns="http://marklogic.com/appservices/search"> <values name="speaker"> <range type="xs:string"> <element ns="" name="SPEAKER"/> </range> </values> <tuples name="speaker-title"> <range type="xs:string"> <element ns="" name="SPEAKER"/> </range> <range type="xs:string"> <path-index>/PLAY/ACT/SCENE/TITLE</path-index> </range> </tuples> </options> $ curl --anyauth --user user:password -i -X GET \ http://localhost:8000/v1/config/query/my-options/values ==> MarkLogic Server returns the following headers and the requested subset of my-options. Results are in the default format, XML. HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 187 Connection: close <options xmlns="http://marklogic.com/appservices/search"> <values name="speaker"> <range type="xs:string"> <element ns="" name="SPEAKER"/> </range> </values> </options>
Assume the following options are installed under the name "my-options": { "options": { "values": [ { "name": "speaker", "range": { "type": "xs:string", "element": { "ns": "", "name": "SPEAKER" } } } ], "tuples": [ { "name": "speaker-title", "range": [ { "type": "xs:string", "element": { "ns": "", "name": "SPEAKER" } }, { "type": "xs:string", "path-index": { "text": "/PLAY/ACT/SCENE/TITLE" } } ] } ] } } $ curl --anyauth --user user:password -i -X GET -H "Accept: application/json" \ 'http://localhost:8000/v1/config/query/my-options/values' ==> MarkLogic Server returns the following headers and the requested subset of my-options, as JSON. HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 112 Connection: close { "options": { "values": [ { "name": "speaker", "range": { "type": "xs:string", "element": { "ns": "", "name": "SPEAKER" } } } ] } }
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.